package com.uduemc.biso.core.feign;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import com.uduemc.biso.core.extities.center.CustomerUser;
import com.uduemc.biso.core.feign.fallback.CustomerUserFeignFallback;
import com.uduemc.biso.core.utils.RestResult;

@FeignClient(value = "BISO-BASIC-SERVICE", fallback = CustomerUserFeignFallback.class)
@RequestMapping(value = "/customer")
public interface CustomerFeign {

	@GetMapping("/user/find-by-username/{username}")
	RestResult getUserByUsername(@PathVariable("username") String username);

	@GetMapping("/user/find-one/{id}")
	RestResult findUserOne(@PathVariable("id") Long id);

	@PutMapping("/user/update-by-id")
	public RestResult updateUserById(@RequestBody CustomerUser customerUser);

	@PutMapping("/user/update-by-id-selective")
	public RestResult updateUserByIdSelective(@RequestBody CustomerUser customerUser);

	@GetMapping("/role/find-by-customer-user-id/{id}")
	RestResult findRoleById(@PathVariable("id") Long id);

}
